<template>
    <div>
        <el-form ref="form" :model="form" label-width="80px" style="width: 500px;">
            <!-- <el-form-item label="课题分类" prop="type_id">
                <el-select v-model="form.type_id" placeholder="请选择活动区域">
                    <el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id">{{ item.name }}</el-option>
                </el-select>
            </el-form-item> -->
            <el-form-item label="课题名称" prop="members">
                <el-input v-model="form.courseName" />
            </el-form-item>
            <el-form-item label="答辩组长" prop="title">
                <el-input v-model="form.headTeacherName" />
            </el-form-item>
            <!-- <el-form-item label="组长工号" prop="title">
                <el-input v-model="form.headTeacherId" />
            </el-form-item>
            <el-form-item label="成员老师1" prop="title">
                <el-input v-model="form.secondTeacherName" />
            </el-form-item>
            <el-form-item label="成员老师2" prop="title">
                <el-input v-model="form.threadTeacherName" />
            </el-form-item>
            <el-form-item label="答辩学生" prop="title">
                <el-input v-model="form.studentName" />
            </el-form-item>
            <el-form-item label="学生学号" prop="title">
                <el-input v-model="form.studentId" />
            </el-form-item> -->
            <el-form-item>
                <el-button type="primary" @click="submit">{{ '发布' }}</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>



<script>
import axios from "axios";
import { mapState,mapActions } from 'vuex';
export default {
    name: 'releasedabian',    // 添加修改课题
    components: { },
    props: {
                vForm: {
        type: Object,
        default: () => ({}) // 设置默认值为空对象
        }
    },
    data() {
        return {
            form: {
                courseName: '',
                // headTeacherId: '',    // 分类 id
                headTeacherName: '',     // 人数上限
                // secondTeacherName: '',      // 课题标题
                // threadTeacherName: '',    // 课题要求
                // studentId: '',  
                // studentName: '', 
                // DabianTime: null, 
                // state: null      // 课题封面
            },
            // rules: {
            //     type_id: [{ required: true, message: '请选择课题分类' }],
            //     members: [{ required: true, message: '请输入人数上限' },{ pattern: /(^[1-9]\d*$)/, message: '请输入正整数' }],
            //     title: [{ required: true, message: '请输入课题标题' }],
            //     conents: [{ required: true, message: '请输入课题要求' }],
            // }
        };
    },
    computed: {
        ...mapState('User',['userInfo']),
        ...mapState('Topic',['typeList']),
    },
    methods: {
        // ...mapActions('Dabian',['releaseDabian']),
        submit(){
            const {courseName,headTeacherName}=this
            this.$API.data.reqData({
                courseName,
                headTeacherName
            });
        }
    },
    mounted() {
        this.getTypes();
        if (this.vForm) this.form = this.vForm;
        this.form.headTeacherId = userInfo.id;
    },
};
</script>

<style lang="less" scoped></style>